home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Aug 90 / MacApp.Tech$ 8⁄10⁄90 / 1699-hiding TGridView col-Aug90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.1 KB  |  58 lines  |  [TEXT/GEOL]

  1. Item    4190555                         6-Aug-90        13:58PDT
  2.  
  3. From:   POWERUP.ENG                     Power Up Software,PRT
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    hiding TGridView columns
  8.  
  9. Attn:   MacApp.Tech$
  10. SentBy: James Plamondon
  11. Date   8/6/90
  12. Subject    hiding TGridView columns
  13. From   James Plamondon
  14. To   MacApp.Tech$
  15.  
  16. Subject:   hiding TGridView columns
  17. Gentlepersons,
  18.  
  19. I need to be able to show and hide columns in a grid view.  When hidden
  20. columns are shown, they need to return to the width they had when previously
  21. shown.  An obvious way to do this is to negate the widths of hidden columns,
  22. so that a column of width 35, when hidden, would have a width of -35.  It
  23. would be necessary to use a width of zero instead of -35 in a number of places
  24. — specifically, for anything having to do with drawing.
  25.  
  26. The widths of columns in a grid view are maintained in a TRunArray, referenced
  27. by TGridView.fColWidths.  I'm thinking about subclassing TRunArray to provide
  28. the functionality I need.  I would need to override the following TRunArray
  29. routines:
  30.     GetValue():  to return zero instead of the actual negative value
  31.     SumValues():  to only add positive values
  32.     FindChunk():  it looks complicated, it's called by SumValues(), so I'll
  33. probably have to change it, too.
  34.  
  35. I'll also have to free the TRunArray allocated and assigned to fColWidths in
  36. the initialization of the TGridView, and create a new one of the new type in
  37. its place.
  38.  
  39. So, my question for the gang is:  Does anybody see any reason why this will
  40. scheme will not work?  Perhaps someone has got such a mechanism working
  41. already — if so, I'd love to share your code, or trade you for some of my
  42. stuff.
  43.  
  44. Looking forward to implementing this feature without having to work too hard,
  45. I remain
  46.  
  47. Yours,
  48.  
  49. James Plamondon
  50.  
  51. P.S.:    This would be more convenient if fColWidths' TRunArray were created
  52. by a CreateColWidths() method, which it is not.  Perhaps that is true of all
  53. owned objects:  that they should be created by Create<FieldName> routines, so
  54. that the class of the created object can be easily overridden.
  55.  
  56. jp
  57.  
  58.